package com.ymttest.database.mapping.godmember;

import com.ymttest.database.model.godmember.MemberPoints;
import com.ymttest.database.model.godmember.MemberPointsExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface MemberPointsMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table memberpoints
     *
     * @mbggenerated Tue May 19 11:10:11 CST 2020
     */
    @SelectProvider(type=MemberPointsSqlProvider.class, method="countByExample")
    int countByExample(MemberPointsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table memberpoints
     *
     * @mbggenerated Tue May 19 11:10:11 CST 2020
     */
    @DeleteProvider(type=MemberPointsSqlProvider.class, method="deleteByExample")
    int deleteByExample(MemberPointsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table memberpoints
     *
     * @mbggenerated Tue May 19 11:10:11 CST 2020
     */
    @Delete({
        "delete from memberpoints",
        "where MemberId = #{memberId,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String memberId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table memberpoints
     *
     * @mbggenerated Tue May 19 11:10:11 CST 2020
     */
    @Insert({
        "insert into memberpoints (MemberId, UserId, ",
        "ShopId, AvailablePoints, ",
        "TotalPoints, OrderNum, ",
        "OrderAmt, LastMonthOrderAmt, ",
        "LastOrderAmt, LastOrderTime, ",
        "LastOrderId, CreateTime, ",
        "UpdateTime)",
        "values (#{memberId,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER}, ",
        "#{shopId,jdbcType=INTEGER}, #{availablePoints,jdbcType=INTEGER}, ",
        "#{totalPoints,jdbcType=INTEGER}, #{orderNum,jdbcType=INTEGER}, ",
        "#{orderAmt,jdbcType=DECIMAL}, #{lastMonthOrderAmt,jdbcType=DECIMAL}, ",
        "#{lastOrderAmt,jdbcType=DECIMAL}, #{lastOrderTime,jdbcType=TIMESTAMP}, ",
        "#{lastOrderId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{updateTime,jdbcType=TIMESTAMP})"
    })
    int insert(MemberPoints record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table memberpoints
     *
     * @mbggenerated Tue May 19 11:10:11 CST 2020
     */
    @InsertProvider(type=MemberPointsSqlProvider.class, method="insertSelective")
    int insertSelective(MemberPoints record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table memberpoints
     *
     * @mbggenerated Tue May 19 11:10:11 CST 2020
     */
    @SelectProvider(type=MemberPointsSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="MemberId", property="memberId", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="UserId", property="userId", jdbcType=JdbcType.INTEGER),
        @Result(column="ShopId", property="shopId", jdbcType=JdbcType.INTEGER),
        @Result(column="AvailablePoints", property="availablePoints", jdbcType=JdbcType.INTEGER),
        @Result(column="TotalPoints", property="totalPoints", jdbcType=JdbcType.INTEGER),
        @Result(column="OrderNum", property="orderNum", jdbcType=JdbcType.INTEGER),
        @Result(column="OrderAmt", property="orderAmt", jdbcType=JdbcType.DECIMAL),
        @Result(column="LastMonthOrderAmt", property="lastMonthOrderAmt", jdbcType=JdbcType.DECIMAL),
        @Result(column="LastOrderAmt", property="lastOrderAmt", jdbcType=JdbcType.DECIMAL),
        @Result(column="LastOrderTime", property="lastOrderTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="LastOrderId", property="lastOrderId", jdbcType=JdbcType.BIGINT),
        @Result(column="CreateTime", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="UpdateTime", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<MemberPoints> selectByExample(MemberPointsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table memberpoints
     *
     * @mbggenerated Tue May 19 11:10:11 CST 2020
     */
    @Select({
        "select",
        "MemberId, UserId, ShopId, AvailablePoints, TotalPoints, OrderNum, OrderAmt, ",
        "LastMonthOrderAmt, LastOrderAmt, LastOrderTime, LastOrderId, CreateTime, UpdateTime",
        "from memberpoints",
        "where MemberId = #{memberId,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="MemberId", property="memberId", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="UserId", property="userId", jdbcType=JdbcType.INTEGER),
        @Result(column="ShopId", property="shopId", jdbcType=JdbcType.INTEGER),
        @Result(column="AvailablePoints", property="availablePoints", jdbcType=JdbcType.INTEGER),
        @Result(column="TotalPoints", property="totalPoints", jdbcType=JdbcType.INTEGER),
        @Result(column="OrderNum", property="orderNum", jdbcType=JdbcType.INTEGER),
        @Result(column="OrderAmt", property="orderAmt", jdbcType=JdbcType.DECIMAL),
        @Result(column="LastMonthOrderAmt", property="lastMonthOrderAmt", jdbcType=JdbcType.DECIMAL),
        @Result(column="LastOrderAmt", property="lastOrderAmt", jdbcType=JdbcType.DECIMAL),
        @Result(column="LastOrderTime", property="lastOrderTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="LastOrderId", property="lastOrderId", jdbcType=JdbcType.BIGINT),
        @Result(column="CreateTime", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="UpdateTime", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    MemberPoints selectByPrimaryKey(String memberId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table memberpoints
     *
     * @mbggenerated Tue May 19 11:10:11 CST 2020
     */
    @UpdateProvider(type=MemberPointsSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") MemberPoints record, @Param("example") MemberPointsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table memberpoints
     *
     * @mbggenerated Tue May 19 11:10:11 CST 2020
     */
    @UpdateProvider(type=MemberPointsSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") MemberPoints record, @Param("example") MemberPointsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table memberpoints
     *
     * @mbggenerated Tue May 19 11:10:11 CST 2020
     */
    @UpdateProvider(type=MemberPointsSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(MemberPoints record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table memberpoints
     *
     * @mbggenerated Tue May 19 11:10:11 CST 2020
     */
    @Update({
        "update memberpoints",
        "set UserId = #{userId,jdbcType=INTEGER},",
          "ShopId = #{shopId,jdbcType=INTEGER},",
          "AvailablePoints = #{availablePoints,jdbcType=INTEGER},",
          "TotalPoints = #{totalPoints,jdbcType=INTEGER},",
          "OrderNum = #{orderNum,jdbcType=INTEGER},",
          "OrderAmt = #{orderAmt,jdbcType=DECIMAL},",
          "LastMonthOrderAmt = #{lastMonthOrderAmt,jdbcType=DECIMAL},",
          "LastOrderAmt = #{lastOrderAmt,jdbcType=DECIMAL},",
          "LastOrderTime = #{lastOrderTime,jdbcType=TIMESTAMP},",
          "LastOrderId = #{lastOrderId,jdbcType=BIGINT},",
          "CreateTime = #{createTime,jdbcType=TIMESTAMP},",
          "UpdateTime = #{updateTime,jdbcType=TIMESTAMP}",
        "where MemberId = #{memberId,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(MemberPoints record);
}